<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
  <%@ page import="java.sql.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<%
request.setCharacterEncoding("utf-8");
String productname=new String(request.getParameter("productname"));
String price=new String(request.getParameter("price"));
String introduce=new String(request.getParameter("introduce"));
  // 数据库连接字符串
  Class.forName("org.mariadb.jdbc.Driver");
  String url = "jdbc:mariadb://10.220.140.102:3366/studb14";
  // 数据库用户名
  String usename = "stu14";
  // 数据库密码
  String psw ="jyw745DJ";
  Connection conn=DriverManager.getConnection(url,usename,psw); //创建连接
  String sql="insert into db_order(userName,password,realName,age,phoneNumber) values('"+productname+"','"+price+"','"+introduce+"')";
    Statement stmt=conn.createStatement();                     //获取statement对象
    stmt.executeUpdate(sql);                                   //执行添加用户的sql语句
    request.getRequestDispatcher("trymenu2.jsp").forward(request, response);  //请求转发到register_success.jsp
%>
</body>
</html>